<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增消费记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-cardConsumeLog-add">
            <div class="form-group">
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>卡池名称：</label>
                <div class="col-sm-3">
                    <select name="cardId" class="form-control m-b" required>
                        <option value="">请选择</option>
                        <option th:each="cardPool : ${cardPoolList}" th:text="${cardPool['cardName']}" th:value="${cardPool['cardId']}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>订购数量：</label>
                <div class="col-sm-8">
                    <input name="orderCount" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>开通数量：</label>
                <div class="col-sm-8">
                    <input name="openCount" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>渠道：</label>
                <div class="col-sm-8">
                    <select name="consumeChannel" class="form-control m-b" th:with="type=${@dict.getType('consume_channel')}" required>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>消费日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <!--结合下面的datetimepicker，设置时分秒-->
                        <!--<input name="syncTime" class="form-control" placeholder="选择日期" type="text" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" required>-->
                        <input name="syncTime" class="form-control" placeholder="选择日期" type="text" data-type="date" data-format="yyyy-MM-dd" required>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>备注：</label>
                <div class="col-sm-8">
                    <input name="remark" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "tencent/cardConsumeLog"
        $("#form-cardConsumeLog-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-cardConsumeLog-add').serialize());
            }
        }

//        //设置选择时分秒
//        $("input[name='syncTime']").datetimepicker({
//            format: 'yyyy-mm-dd hh:ii:ss',
//            autoclose: true,
//            minView: 0,
//            minuteStep:1
//        });

        $("input[name='syncTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>